function Person(name, age) {
    this.name = name;
    this.age = age;
}
Person.prototype.getName = function () {
    return this.name;
};
Person.prototype.getAge = function () {
    return this.age;
};
//Programmer extend Person;===== method 1
function Programmer(name, age) {
    Person.call(this, name, age);
    /*===extend start===*/
    this.prototype = new Person;
    /*===extend end===*/
}
Programmer.prototype.think = function () {
    console.log('Thinking how to coding!');
};
Programmer.prototype.sayHi = function () {
    console.log('Hello world!');
};
//Programmer extend Person;===== method 2
function Programmer2(name, age) {
    Person.call(this, name, age);
    /*===extend start===*/
    var F = function () {};
    F.prototype = Person.prototype;
    this.prototype = new F();
    /*===extend end===*/
    this.prototype.constructor=Programmer2;
}
Programmer2.prototype.think = function () {
    console.log('Thinking how to coding!');
};
Programmer2.prototype.sayHi = function () {
    console.log('Hello world!');
};